package com.neuedu.user.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neuedu.user.entity.Guestbook;
import com.neuedu.user.service.GuestbookService;

@RestController
@RequestMapping("/GuestbookController")
public class GuestbookController {
	
	@Autowired
    private GuestbookService service;
	
	@RequestMapping("/getGuestbook")
	//http://localhost:8090/GuestbookController/getGuestbook
	public List<Guestbook> getGuestbook(){
		return service.getGuestbook();
	}
	@RequestMapping("/deleteGuestbook")
	public int deleteGuestbook(Guestbook u) {
		return service.deleteGuestbook(u);
	}
	@RequestMapping("/getGuestByCid")
	public List<Guestbook> getGuestByCid(Guestbook c){
		System.out.println(c);
		return service.getGuestByCid(c);
	}
	@RequestMapping("/addGuestbook")
	public int addGuestbook(Guestbook u) {
		System.out.println(u);
		return service.addGuestbook(u);
	}
}
